This folder contains the replication files for the paper “Preferring National Elites or Local Candidates: A
Conjoint Analysis of Voter Heuristics”. 

A docker image can also be pulled from gagnonetienne94/local_elite_image on dockerhub to easily reproduce the whole project. 


The directory structure is as follows: 
.
├── data/
│   ├── main_survey_final.csv
│   ├── follow_up_survey_formatted.rds
│   ├── candidate_dataset.csv
│   ├── follow_up_survey_final.csv
│   ├── first_survey_formatted.rds
│   └── local_candidates.csv
├── mappings/
│   ├── attribute_mapper.yaml
│   ├── colnames_mapper.yaml
│   └── plot_label_mapper.yaml
├── figures/
│   ├── appendix_plots/
│   └── paper_plots/
├── 1_format_first_survey.R
├── 2_format_second_survey.R
├── 3_first_conjoint_mm_main_effects.R
├── 4_second_experiment_main_effects.R
├── 5_treatment_effect_heterogeneity.R
├── 6_university_ratings.R
├── 7_make_candidate_data_table.R
├── 8_no_carryover_assumption_tests_exp1.R
├── 9_no_carryover_assumption_tests_exp2.R
├── 10_make_descriptive_table.R
├── 11_satisficer_check_main_survey.R
├── 12_satisficer_check_second_survey.R
├── prepare_candidate_char_table.py
├── output_log.txt
├── Codebook.pdf
├── replicate_results.sh
└── Dockerfile

The data directory contains 6 files. Main_survey_final.csv is the file containing raw qualtrics data from our initial survey. follow_up_survey_final.csv contains raw qualtrics data from our follow up survey. Candidate_dataset.csv data edited the reed-smith dataset of Japanese lower house election candidates which is used to produce the data from table 1. main_survey_formatted.rds and follow_up_survey_formatted.rds are the files outputted by 1_format_first_survey.R and 2_format_second_survey.R, they are included for convenience but can be produced easily from the raw qualtrics outputs and the R scripts. local_candidates.csv is a file containing the data to reproduce table 1, it can be reproduced from the raw data found in candidate_dataset.csv. 

The mappings  directory contains a set of mappings in yaml files that are used to process plot labels, rename certain columns and translate the conjoint attributes from Japanese to English. 

Figures is a directory where figures are outputted by the various R scripts. 

The R scripts are to be run in the order they are numbered to produce all the figures found in the paper. 

prepare_candidate_char_table.py is a python script that reproduces table 1.  Table 2 is reproduced by R script #8’s console output. Table 3 is produced by R script #10’s console output.

replicate_results.sh is a bash script that runs all of the R scripts 

Output_log.txt contains the output from running all 12 R scripts

Dockerfile can be run through docker to easily produce an environment able to run the R scripts. 

Codebook.pdf contains the codebooks for our two surveys.

Note that for certain figures to be reproduced properly your system needs to be able to process UTF-8 encoding for the CJK characters. The environment in dockerfile is setup properly for this. 

